Troubleshooting Applets

Well, your applet doesn't work! Now let's find out why?

Look into the Java Console, Netscape has it under Options menu. You probably would like some more information.

The most frequent errors (Exceptions)

Class not found Exception:

First look into the Netscape console and you should find a class name which wasn't found. Check that name, have you such .class file in your server directory? Compare each letter, Java is case sensitive, so all must match exactly. One is in CODE="filename.class" with the filename that you uploaded to the server and one is in the JavaConsole. Well, more than likely you will find that the console message has a filename quite different from the applet's name. That means that the applet that you are trying to run needs to use other classes, so that means that you did not upload all of the classes. It may also be that the .zip file that you downloaded did not contain everything. But, it s not likely.

Class Format Error:

Oh, well, the most frequent reason for errors is an attempt to rename the file.class or changing the names to uppercase or lowercase. Your code="filename.class" must match with the filename.class in your directory, but the class file which contains the class name is also somewhere inside that file, so you can't change it. Another reason is that one did not upload in binary mode, or the file was corrupted while uploading. In that case, it is better to remove the file from the server. Proceed with the following steps: exit or quit your browser, restart your browser and clear the cache and upload files again with the correct filename. It may even be necessary to restart your computer. In extreme cases, one may need to run a program, such as Norton Utilities, to correct any problems.

Cache problems:

The applet can't be reloaded (at least in most browsers)! That really annoys me, because sometimes errors occur while loading the applet from the net. You have some errors with applets today which worked fine for you yesterday. Well you hit reload and nothing changes...You need to completely restart Netscape, clear cache and go to that page. And it works.... On Windows, it looks at only a certain number of digits. With the latest version or Windows 95 the filename can be very long. If your operating system is old, and the applet class files have long names then you may be out of luck. Similarly with Macintosh, if the file name is longer than 32 letters then the operating system won't recognize it. Sorry!

To be continued...